package com.xq.demo;

import lombok.Data;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;

import java.util.*;
import java.util.stream.Collectors;

public class Test2 {

    public static void main(String[] args) throws Exception{

            Demo1 demo1 = new Demo1();
            demo1.setCreateDate("2020-01-21 12:11:13");

            Demo2 demo2 = new Demo2();
            demo2.setCreateDateTime(DateUtils.parseDate(demo1.createDate));
    }


    @Data
    static class Demo1{
       private String createDate;
    }


    @Data
    static class Demo2{
        private Date createDateTime;
    }

}
